{php include wl_template('common/header-base')}
{if empty($_GPC['lct'])}
<div class="head">
	<div class="app-sidebar">
		<div class="head-before">
			<div class="head-logo" style="background-image:url({if $_W['wlsetting']['base']['logo']}{php echo tomedia($_W['wlsetting']['base']['logo'])}{else}{php echo tomedia('headimg_'.$_W['account']['acid'].'.jpg')}{/if});"></div>
		</div>
		<div class="app-sidebar-list">
			<div class="">
				<ul class="">
					{php $top_menus = is_store() ? Menus_store::topmenus() : (is_agent() ? Menus::topmenus() : Menus_sys::topmenus());}
					{loop $top_menus $topmenus}
                        {if in_array($topmenus['jurisdiction'],Jurisdiction::judgeMainMenu($_W['jurisdiction'])) || !$_W['jurisdiction']}
					        <li {if is_array($topmenus['active']) && in_array($_W['plugin'], $topmenus['active'])}class="active"{elseif $_W['plugin'] == $topmenus['active']}class="active"{/if} {if is_array($topmenus['active'])}{/if}><a href="{$topmenus['url']}">{$topmenus['title']}</a></li>
                        {/if}
                    {/loop}
			    </ul>
			</div>
		</div>
	</div>
	<div class="app-login-info">
		<div class="app-login-info-name">
			<div class="app-login-info-name-d">
				<div class="face"><i class="icon iconfont icon-peoplefill"></i></div>
				<div class="name">
                    {if is_store()}
                        {$_W['storeuser']['nickname']}
                    {elseif is_agent() && !$_W['jurisdiction']}
                        {$_W['agent']['username']}
                    {elseif $_W['jurisdiction']}
                        {$_W['EInfor']['account']}
                    {else}
                        {$_W['user']['username']}
                    {/if}
                </div>
			</div>
		</div>
		<div class="app-login-info-sel">
			<div class="app-login-info-sel-arrow"></div>
			<div class="app-login-info-sel-d">
				{if is_store()}
                    <a href="{php echo web_url('user/storelogin/storeLogin');}">
                        <div class="sel-p sel-p-no-line">
                            <div class="sel-p-l"><div class="h3">切换店铺</div></div>
                            <div class="sel-p-r"><i class="icon iconfont icon-right"></i></div>
                        </div>
                    </a>
                    <a href="{php echo web_url('user/storelogin/logout', ['i' => $_W['uniacid']]);}">
                    <div class="sel-p login-out">
                        <div class="sel-p-l"><div class="h3">退出登录</div></div>
                        <div class="sel-p-r"><i class="icon iconfont icon-exit"></i></div>
                    </div>
                </a>
				{elseif is_agent() && !$_W['jurisdiction']}
                    <a href="{php echo web_url('agentset/agentSetAccount/profile');}">
                        <div class="sel-p sel-p-no-line">
                            <div class="sel-p-l"><div class="h3">{$_W['agent']['username']}</div></div>
                            <div class="sel-p-r"><i class="icon iconfont icon-right"></i></div>
                        </div>
                    </a>
                    <a href="{php echo web_url('user/login/logout');}">
                        <div class="sel-p login-out">
                            <div class="sel-p-l"><div class="h3">退出登录</div></div>
                            <div class="sel-p-r"><i class="icon iconfont icon-exit"></i></div>
                        </div>
                    </a>
                {elseif $_W['jurisdiction']}
                    <a href="{if in_array('agentset/agentSetStaff/adminset', $_W['jurisdiction'])}{php echo web_url('agentset/agentSetStaff/adminedit',array('id'=>$_W['EInfor']['id']));}{else}javascript:;{/if}">
                        <div class="sel-p sel-p-no-line">
                            <div class="sel-p-l"><div class="h3">{$_W['EInfor']['account']}</div></div>
                            <div class="sel-p-r"><i class="icon iconfont icon-right"></i></div>
                        </div>
                    </a>
                    {if is_agent()}
                        <a href="{php echo web_url('user/login/logout');}">
                            <div class="sel-p login-out">
                                <div class="sel-p-l"><div class="h3">退出登录</div></div>
                                <div class="sel-p-r"><i class="icon iconfont icon-exit"></i></div>
                            </div>
                        </a>
                    {else}
                        <a href="{php echo web_url('user/login/adminStaffLogout');}">
                            <div class="sel-p login-out">
                                <div class="sel-p-l"><div class="h3">退出登录</div></div>
                                <div class="sel-p-r"><i class="icon iconfont icon-exit"></i></div>
                            </div>
                        </a>
                    {/if}
                {elseif defined('IS_INDEPENDENT')}
                    <a href="javascript:;">
                        <div class="sel-p sel-p-no-line">
                            <div class="sel-p-l"><div class="h3">{$_W['user']['username']}</div></div>
                            <div class="sel-p-r"><i class="icon iconfont icon-right"></i></div>
                        </div>
                    </a>
                    <a href="{php echo web_url('member/login/logOut');}">
                        <div class="sel-p login-out">
                            <div class="sel-p-l"><div class="h3">退出登录</div></div>
                            <div class="sel-p-r"><i class="icon iconfont icon-exit"></i></div>
                        </div>
                    </a>
                {else}
                {if IMS_FAMILY == 'wl'}
                    <a href="./home.php">
                {else}
                    <a href="{url 'home/welcome'}">
                {/if}
                    <div class="sel-p">
                        <div class="sel-p-l"><div class="h3">返回系统</div></div>
                        <div class="sel-p-r"></div>
                    </div>
                </a>
                <a href="{url 'user/profile'}">
                    <div class="sel-p sel-p-no-line">
                        <div class="sel-p-l"><div class="h3">{$_W['user']['username']}</div></div>
                        <div class="sel-p-r"><i class="icon iconfont icon-right"></i></div>
                    </div>
                </a>
                <a href="{url 'user/logout'}">
                    <div class="sel-p login-out">
                        <div class="sel-p-l"><div class="h3">退出登录</div></div>
                        <div class="sel-p-r"><i class="icon iconfont icon-exit"></i></div>
                    </div>
                </a>
				{/if}
			</div>
		</div>
	</div>
</div>

<div class="container-fluid main-body">
	{if defined('IN_MESSAGE')}
	<div class="jumbotron clearfix alert alert-{$label}">
		<div class="row">
			<div class="col-xs-12 col-sm-3 col-lg-2">
				<i class="fa fa-5x fa-{if $label=='success'}check-circle{/if}{if $label=='danger'}times-circle{/if}{if $label=='info'}info-circle{/if}{if $label=='warning'}exclamation-triangle{/if}"></i>
			</div>
			<div class="col-xs-12 col-sm-8 col-sm-9 col-lg-10">
				{if is_array($msg)}
					<h2>MYSQL 错误：</h2>
					<p>{php echo cutstr($msg['sql'], 300, 1);}</p>
					<p><b>{$msg['error'][0]} {$msg['error'][1]}：</b>{$msg['error'][2]}</p>
				{else}
				<h2>{$caption}</h2>
				<p>{$msg}</p>
				{/if}
				{if $redirect}
				<p><a href="{$redirect}">如果你的浏览器没有自动跳转，请点击此链接</a></p>
				<script type="text/javascript">
					setTimeout(function () {
						location.href = "{$redirect}";
					}, 3000);
				</script>
				{else}
					<p>[<a href="javascript:history.go(-1);">点击这里返回上一页</a>] &nbsp; [<a href="./?refresh">首页</a>]</p>
				{/if}
			</div>
	{else}
	{php $frames_name = get.$_W['plugin'].Frames;$menusclass = is_store() ? Menus_store : (is_agent() ? Menus : Menus_sys);$frames = $menusclass::$frames_name(); $menusclass::_calc_current_frames2($frames);}
	<div class="app-container {if empty($frames)}empty-big-menu{/if}">
		{if !empty($frames)}
			<div class="big-menu second-sidebar">
				<div class="second-sidebar-t">
					{loop $top_menus $topmenus}
					{if (is_array($topmenus['active']) && in_array($_W['plugin'], $topmenus['active'])) || ($_W['plugin'] == $topmenus['active'])}{php echo mb_substr($topmenus['title'], -2, 2, 'UTF8');}中心{/if}
					{/loop}
				</div>
				<div class="second-sidebar-c">
					{loop $frames $k $frame}
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h4 class="panel-title">{$frame['title']}</h4>
                            </div>
                            <ul class="list-group collapse in" id="frame-{$k}">
                                {if $_W['jurisdiction']}
                                    <!--代理商员工登录时 只显示有操作权限的菜单-->
                                    {loop $frame['items'] $link}
                                        {if in_array(Util::urlRestore($link['url']),$_W['jurisdiction']) || !in_array(Util::urlRestore($link['url']),$_W['JUrlList'])}
                                            {if !empty($link['append'])}
                                                <li class="list-group-item {$link['active']}" onclick="window.location.href = '{$link['url']}';" style="cursor:pointer;padding-left: 40px;" kw="{$link['title']}">
                                                    {$link['title']}
                                                    <a class="pull-right" href="{$link['append']['url']}">{if empty($link['append']['title'])}0{else}{$link['append']['title']}{/if}</a>
                                                </li>
                                            {else}
                                                <a class="list-group-item {$link['active']}" href="{$link['url']}" kw="{$link['title']}" style="padding-left: 40px;">{$link['title']}</a>
                                            {/if}
                                        {/if}
                                    {/loop}
                                {else}
                                    {loop $frame['items'] $link}
                                        {if !empty($link['append'])}
                                            <li class="list-group-item {$link['active']}" onclick="window.location.href = '{$link['url']}';" style="cursor:pointer;padding-left: 40px;" kw="{$link['title']}">
                                                {$link['title']}
                                                <a class="pull-right" href="{$link['append']['url']}">{if empty($link['append']['title'])}0{else}{$link['append']['title']}{/if}</a>
                                            </li>
                                        {else}
                                            <a class="list-group-item {$link['active']}" href="{$link['url']}" kw="{$link['title']}" style="padding-left: 40px;">{$link['title']}</a>
                                        {/if}
                                    {/loop}
                                {/if}
                            </ul>
                        </div>
					{/loop}
				</div>
			</div>
			<div class="app-container-right">
		{else}
			<div class="app-container-right">
		{/if}
	{/if}
{/if}